package gui;

import java.awt.FlowLayout;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import javax.swing.JFrame;

import tag.Canvas;
import tag.constants;
import tag.framable;

public class frame implements framable{
	
	static framable instance = myFrame.getInstance();

	public static framable getInstance() {

		return instance;
	}

	@SuppressWarnings("serial")
	static
	class myFrame extends JFrame implements framable,Canvas,constants{
		static framable instance = null;
		
		
		private myFrame(){
			
			setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
			//setSize(frame_width,frame_height);
			setResizable(false);
			setUndecorated(true);
			GraphicsEnvironment localEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
			GraphicsDevice defaultDevice = localEnvironment.getDefaultScreenDevice();
			
			
			defaultDevice.setFullScreenWindow(this);
			
			add(pane);
		}
		
		
		public static framable getInstance(){
			
			return instance==null?instance=new myFrame():instance;
			
		}
	}

	public void setVisible(boolean b) {
		
		((JFrame)instance).setVisible(true);
		
	}

	public int getHeight() {
		
		return ((JFrame)instance).getContentPane().getHeight();
	}

	public int getWidth() {
		return ((JFrame)instance).getContentPane().getWidth();
	}


}

